package dfbz.demo.demo06;

public class Person {
    private String name;
    private int age;
    private Subject subject;

    public Person() {
    }

    public Person(String name, int age, Subject subject) {
        this.name = name;
        this.age = age;
        this.subject = subject;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Subject getSubject() {
        return subject;
    }

    public void setSubject(Subject subject) {
        this.subject = subject;
    }
    public void show(){
        System.out.println(this.name+","+this.age+"岁,"+this.subject.getSubName());
    }
}
